#pragma once
#include"rbtree.hpp"
namespace yjl
{
	template<class K,class V>
	class mymap
	{
	
		struct MapkeyofT
		{
			const K& operator()(const pair<K, V>& kv)
			{
				return kv.first;
			}
		};
	public:
		typedef typename rbtree<K, pair<const K, V>, MapkeyofT>::Iterator iterator;
		iterator begin()
		{
			return rb.begin();
		}
		iterator end()
		{
			return rb.end();
		}
		bool insert(const pair<K, V>& data)
		{
			return rb.Insert(data);

		}
	private:
		rbtree<K, pair<const K,V>, MapkeyofT> rb;
	};
}